package com.kichina.galaxy.dev.tools.aliyun.model.bean;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;
import java.util.Map;

/**
 * @author Surging
 * @version 1.0
 * @ClassName AliyunModelPropertie
 * @date 2022/6/1 19:11
 * @desc Aliyun 属性数据模型规范
 *
 * {
 * "properties":[
 * {
 * "identifier":"SimCardType",
 * "dataSpecs":{
 * "max":"1",
 * "dataType":"INT",
 * "unit":"mmHg",
 * "min":"0",
 * "step":"1"
 * },
 * "std":false,
 * "custom":true,
 * "dataType":"INT",
 * "rwFlag":"READ_ONLY",
 * "productKey":"gd83Jw4TkT8",
 * "required":false,
 * "customFlag":true,
 * "name":"sim卡类型"
 * }
 * ]
 * }
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class AliyunModelProperties {

    private String productKey;

    private String identifier;

    private String dataType;

    /**
     * dataType为INT的dataSpecs示例：
     * {
     *   "dataSpecs": {
     *     "custom": true,
     *     "dataType": "INT",
     *     "defaultValue": "30",
     *     "max": "1440",
     *     "min": "0",
     *     "step": "10",
     *     "unit": "min"
     *   }
     * }
     * dataType为TEXT的dataSpecs示例：
     * {
     *   "dataSpecs": {
     *     "custom": true,
     *     "dataType": "TEXT",
     *     "id": 2412127,
     *     "length": 2048
     *   }
     * }
     * dataType为ARRAY的dataSpecs示例：
     * {
     *   "dataSpecs": {
     *     "childDataType": "INT",
     *     "custom": true,
     *     "dataType": "ARRAY",
     *     "size": 1
     *   }
     * }
     * dataType为ENUM的dataSpecsList示例：
     * {
     *   "dataSpecsList": [
     *     {
     *       "custom": false,
     *       "dataType": "ENUM",
     *       "defaultValue": "true",
     *       "name": "打开",
     *       "value": 1
     *     },
     *     {
     *       "custom": false,
     *       "dataType": "ENUM",
     *       "defaultValue": "false",
     *       "name": "关闭",
     *       "value": 0
     *     }
     *   ]
     * }
     * dataType为STRUCT的dataSpecsList示例：
     * {
     *   "childDataType": "TEXT",
     *   "childName": "卡编号",
     *   "dataSpecs": {
     *     "custom": true,
     *     "dataType": "TEXT",
     *     "length": 128
     *   },
     *   "dataType": "STRUCT",
     *   "identifier": "CardNo",
     *   "name": "NVR所拥有的芯片信息"
     * }
     */

    private Map<String, Object> dataSpecs;

    private List<DataSpecsModel> dataSpecsList;

    private String name;

    /**
     * READ_WRITE:读写
     * READ_ONLY:只读
     */
    private String rwFlag;
//    是否是标准品类的必选服务。
    private Boolean required;
//参数std和customFlag已过期，不影响API接口调用，此处不再说明。
    private Boolean customFlag;

//    dataType为INT的dataSpecs示例：
}
